
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>Renderer · ZanProxy</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="../../../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../../../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../../../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../../../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../../../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="../../../cooperation/" />
    
    
    <link rel="prev" href="main.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../../../">
            
                <a href="../../../">
            
                    
                    简介
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../../../quick-start/">
            
                <a href="../../../quick-start/">
            
                    
                    快速开始
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="../../../quick-start/pre-install.html">
            
                <a href="../../../quick-start/pre-install.html">
            
                    
                    前置条件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="../../../quick-start/install.html">
            
                <a href="../../../quick-start/install.html">
            
                    
                    安装
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="../../../quick-start/launch.html">
            
                <a href="../../../quick-start/launch.html">
            
                    
                    启动
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4" data-path="../../../quick-start/cert.html">
            
                <a href="../../../quick-start/cert.html">
            
                    
                    证书安装
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../../../configure/">
            
                <a href="../../../configure/">
            
                    
                    代理配置
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../../../configure/host.html">
            
                <a href="../../../configure/host.html">
            
                    
                    Host管理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="../../../configure/rule.html">
            
                <a href="../../../configure/rule.html">
            
                    
                    转发规则
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="../../../configure/project.html">
            
                <a href="../../../configure/project.html">
            
                    
                    工程路径
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.4" data-path="../../../configure/mock.html">
            
                <a href="../../../configure/mock.html">
            
                    
                    mock数据
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../../../usage/">
            
                <a href="../../../usage/">
            
                    
                    使用代理
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="../../../usage/chrome.html">
            
                <a href="../../../usage/chrome.html">
            
                    
                    chrome代理配置
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="../../../usage/mobile.html">
            
                <a href="../../../usage/mobile.html">
            
                    
                    手机代理设置
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="../../../usage/enable.html">
            
                <a href="../../../usage/enable.html">
            
                    
                    规则启用/禁用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.4" data-path="../../../usage/monitor.html">
            
                <a href="../../../usage/monitor.html">
            
                    
                    请求监控
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../../../plugin/">
            
                <a href="../../../plugin/">
            
                    
                    自定义插件
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="../../../plugin/code.html">
            
                <a href="../../../plugin/code.html">
            
                    
                    编写插件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="../../../plugin/usage.html">
            
                <a href="../../../plugin/usage.html">
            
                    
                    使用插件
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../../">
            
                <a href="../../">
            
                    
                    Mac 客户端
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../../use.html">
            
                <a href="../../use.html">
            
                    
                    使用方式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="../">
            
                <a href="../">
            
                    
                    插件开发
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.2.1" data-path="../directory.html">
            
                <a href="../directory.html">
            
                    
                    目录结构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2.2" data-path="../architecture.html">
            
                <a href="../architecture.html">
            
                    
                    项目架构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2.3" data-path="../type-system.html">
            
                <a href="../type-system.html">
            
                    
                    类型系统
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2.4" >
            
                <span>
            
                    
                    插件开发指南
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.2.4.1" data-path="../plugin-guide/start.html">
            
                <a href="../plugin-guide/start.html">
            
                    
                    新建插件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2.4.2" data-path="../plugin-guide/manager.html">
            
                <a href="../plugin-guide/manager.html">
            
                    
                    Manager
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2.4.3" data-path="../plugin-guide/renderer.html">
            
                <a href="../plugin-guide/renderer.html">
            
                    
                    Renderer
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6.2.5" >
            
                <span>
            
                    
                    API参考
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.2.5.1" data-path="main.html">
            
                <a href="main.html">
            
                    
                    Main
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.6.2.5.2" data-path="renderer.html">
            
                <a href="renderer.html">
            
                    
                    Renderer
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../../../cooperation/">
            
                <a href="../../../cooperation/">
            
                    
                    团队协作
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="../../../cooperation/remoteRule.html">
            
                <a href="../../../cooperation/remoteRule.html">
            
                    
                    远程规则
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../../.." >Renderer</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h2 id="renderer-&#x8FDB;&#x7A0B;-api-&#x53C2;&#x8003;&#x6587;&#x6863;">Renderer &#x8FDB;&#x7A0B; API &#x53C2;&#x8003;&#x6587;&#x6863;</h2>
<h3 id="&#x5168;&#x5C40;&#x53D8;&#x91CF;">&#x5168;&#x5C40;&#x53D8;&#x91CF;</h3>
<p><code>window</code>&#x4E0B;&#x6302;&#x8F7D;&#x4E86;&#x4E24;&#x4E2A;&#x5168;&#x5C40;&#x53D8;&#x91CF;&#xFF1A;</p>
<ol>
<li>__static&#xFF0C;&#x6307;&#x5411; static &#x9759;&#x6001;&#x8D44;&#x6E90;&#x76EE;&#x5F55;</li>
<li>__plugins&#xFF0C;&#x7528;&#x6765;&#x5B58;&#x50A8;&#x63D2;&#x4EF6;&#x5728; renderer &#x8FDB;&#x7A0B;&#x4E2D;&#x88AB;&#x9700;&#x8981;&#x88AB;&#x8C03;&#x7528;&#x7684;&#x5404;&#x79CD;&#x51FD;&#x6570;&#x548C;&#x7EC4;&#x4EF6;</li>
</ol>
<h3 id="store">Store</h3>
<h4 id="workspacestore">WorkspaceStore</h4>
<p>WorkspaceStore &#x4E2D;&#x5B58;&#x50A8;&#x4E86;&#x4E0E;&#x5DE5;&#x4F5C;&#x533A;&#x6709;&#x5173;&#x7684;&#x4E00;&#x4E9B;&#x4FE1;&#x606F;&#x548C;&#x65B9;&#x6CD5;&#xFF0C;&#x662F;&#x6700;&#x5E38;&#x7528;&#x7684; store&#x3002;</p>
<p>&#x5F15;&#x5165;&#x65B9;&#x6CD5;:</p>
<pre><code class="lang-ts"><span class="hljs-keyword">import</span> { WorkspaceStore } from <span class="hljs-string">&apos;@gui/renderer/store&apos;</span>;
</code></pre>
<ul>
<li><p><code>workspaces: ZanProxyMac.IWorkspace[]</code>: &#x5DE5;&#x4F5C;&#x533A;&#x7684;&#x5217;&#x8868;&#x6570;&#x7EC4;&#xFF0C;&#x5305;&#x62EC;&#x4E86;&#x6240;&#x6709;&#x53EF;&#x7528;&#x7684;&#x5DE5;&#x4F5C;&#x533A;&#x4FE1;&#x606F;</p>
</li>
<li><p><code>currentWorkspace: ZanProxyMac.IWorkspace</code>: &#x5F53;&#x524D;&#x5728;&#x53F3;&#x4FA7;&#x663E;&#x793A;&#x7684;&#x6B63;&#x5728;&#x7F16;&#x8F91;&#x7684;&#x5DE5;&#x4F5C;&#x533A;&#x4FE1;&#x606F;&#xFF0C;&#x6CE8;&#x610F;&#x5728;&#x8FD9;&#x4E2A;&#x5BF9;&#x8C61;&#x4E0A;&#x8FDB;&#x884C;&#x4FEE;&#x6539;&#x65F6;&#xFF0C;&#x4E0D;&#x4F1A;&#x7ACB;&#x523B;&#x540C;&#x6B65;&#x5230; workspaces &#x5C5E;&#x6027;&#x4E2D;&#xFF0C;&#x53EA;&#x6709;&#x5728;&#x4FDD;&#x5B58;&#x540E;&#xFF0C;&#x4FE1;&#x606F;&#x624D;&#x4F1A;&#x88AB;&#x540C;&#x6B65;&#x3002;</p>
</li>
<li><p><code>activatedWorkspace: ZanProxyMac.IWorkspace</code>: &#x5F53;&#x524D;&#x88AB;&#x6FC0;&#x6D3B;&#xFF0C;&#x5373;&#x6B63;&#x5728;&#x4F7F;&#x7528;&#x7684;&#x5DE5;&#x4F5C;&#x533A;&#x7684;&#x4FE1;&#x606F;</p>
</li>
<li><p><code>setCurrentWorkspaceAttrs: (attrs: Partial&lt;ZanProxyMac.IWorkspace&gt;) =&gt; void</code>: &#x63A5;&#x6536;&#x4E00;&#x4E2A;&#x5BF9;&#x8C61;&#xFF0C;&#x7528;&#x6765;&#x8BBE;&#x7F6E;&#x5F53;&#x524D;&#x5DE5;&#x4F5C;&#x533A;&#x7684;&#x5C5E;&#x6027;&#x3002;</p>
</li>
</ul>
<h3 id="utils">Utils</h3>
<ul>
<li><p><code>ipcSend</code>: <code>&lt;R = any&gt; (channel: string, ...reqArgs) =&gt; Promise&lt;R&gt;</code></p>
<p>&#x5F15;&#x5165;&#x65B9;&#x6CD5;:</p>
<pre><code class="lang-ts"><span class="hljs-keyword">import</span> { ipcSend } from <span class="hljs-string">&apos;@gui/renderer/utils&apos;</span>;
</code></pre>
<p>&#x6A21;&#x62DF; Ajax &#x4E0E; Main &#x8FDB;&#x7A0B;&#x8FDB;&#x884C;&#x901A;&#x4FE1;&#x7684;&#x5C01;&#x88C5;&#x51FD;&#x6570;&#xFF0C;&#x63A5;&#x6536;&#x53C2;&#x6570;&#x4E0E; ipcRenderer.send &#x76F8;&#x540C;&#xFF0C;&#x8FD4;&#x56DE;&#x4E00;&#x4E2A; Promise&#xFF0C;&#x8BE5; Promise &#x4F1A;&#x7B49;&#x5F85; Main &#x8FDB;&#x7A0B;&#x4E2D; <code>setIpcReplier</code> &#x8BBE;&#x7F6E;&#x7684;&#x5BF9;&#x5E94;&#x4FE1;&#x9053;&#x7684;&#x5904;&#x7406;&#x51FD;&#x6570;&#x6267;&#x884C;&#x5B8C;&#x6BD5;&#x540E; resolve &#x6216; reject&#x3002;</p>
</li>
</ul>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="main.html" class="navigation navigation-prev " aria-label="Previous page: Main">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="../../../cooperation/" class="navigation navigation-next " aria-label="Next page: 团队协作">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"Renderer","level":"1.6.2.5.2","depth":4,"next":{"title":"团队协作","level":"1.7","depth":1,"path":"cooperation/README.md","ref":"cooperation/README.md","articles":[{"title":"远程规则","level":"1.7.1","depth":2,"path":"cooperation/remoteRule.md","ref":"cooperation/remoteRule.md","articles":[]}]},"previous":{"title":"Main","level":"1.6.2.5.1","depth":4,"path":"gui/plugin/api/main.md","ref":"gui/plugin/api/main.md","articles":[]},"dir":"ltr"},"config":{"plugins":[],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":false,"twitter":false,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":[]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"ZanProxy","links":{"gitbook":false,"sharing":{"google":false,"facebook":false,"twitter":false,"all":false}},"gitbook":"*"},"file":{"path":"gui/plugin/api/renderer.md","mtime":"2019-03-08T06:06:12.814Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-03-08T06:08:21.743Z"},"basePath":"../../..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../../../gitbook/gitbook.js"></script>
    <script src="../../../gitbook/theme.js"></script>
    
        
        <script src="../../../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../../../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../../../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../../../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../../../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../../../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

